Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nlp): expand aliases to improve natural language understanding and dedupe days & months #644

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dillonstreator
Copy link

Enhanced Natural Language Parser Flexibility

This PR improves the natural language parsing capabilities by adding support for more common variations and abbreviations in date/time expressions.

Changes

  • Added support for business/work day variations (e.g., "business days", "work days")
  • Enhanced weekday parsing to handle more abbreviations (e.g., "Mon.", "Tue.", "Wed.")
  • Added support for month abbreviations with periods (e.g., "Jan.", "Feb.", "Sept.")
  • Added support for time unit shortcuts (e.g., "hr", "mins")
  • Added support for "@" symbol as an alternative to "at" for time specifications
  • Added deduplication for repeated weekdays and months in expressions
  • Added support for "&" as a list separator alongside "and" and commas
  • Improved error messages by including the unknown symbol in the error text

Examples of New Supported Formats

"Every Mon & Wed" → RRULE:FREQ=WEEKLY;BYDAY=MO,WE
"Every business day" → RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR
"Every day @ 10" → RRULE:FREQ=DAILY;BYHOUR=10
"Every 2 hrs" → RRULE:INTERVAL=2;FREQ=HOURLY

Testing

  • Added comprehensive test cases for all new format variations
  • Converted test suite to use it.each for better test organization and failure reporting
  • No regressions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant